GLOBAL.DEBUG = true;
test = require('assert');
//test.equal(1,2);
var Db = require('mongodb').Db;
var Server = require('mongodb').Server;

var client = new Db('test',new Server("127.0.0.1",27017,{}));
var test = function(err,collection){
	
	collection.remove({},function(err,docs){
		console.log('remove all');
		
	});
	
	collection.insert({a:2},function(err,docs){
		
		console.log("insert");
		
		collection.count(function(err,count){
			console.info(count);
		});
		
		collection.find().toArray(function(err,results){
				
			console.log(results);
		
			client.close();
		
		});
		
		
		
	});
	

};

client.open(function(err,p_client){
	client.collection('test_insert',test);
});